package com.zhongjian.technologycal.mall.http;

/**
 * 网络返回基类 支持泛型
 */
public class BaseResponse<T> {

    private int error_code;
    private String error_message;
    private T data;

    public int getCode() {
        return error_code;
    }

    public void setCode(int code) {
        this.error_code = code;
    }

    public String getMsg() {
        return error_message;
    }

    public void setMsg(String msg) {
        this.error_message = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public boolean isOk() {
        return error_code == 0;
    }

    @Override
    public String toString() {
        return "BaseRespose{" +
                "code='" + error_code + '\'' +
                ", msg='" + error_message + '\'' +
                ", data=" + data +
                '}';
    }

}
